<template>
	<view class="content">
		<image class="logo" src="/static/logo.png"></image>
		<view>
			<text class="title">{{title}}</text>
			<div @click="redirect">点击</div>
		</view>
	</view>
</template>

<script>
	var _self;
	export default {
		data() {
			return {
				title: 'Hello'
			}
		},
		onLoad() {
			_self = this;
			 // #ifdef APP-PLUS
			 // setStyle 仅 5 + app 有用
			 _self.$mp.page.$getAppWebview().setStyle({
				 titleText: "首页"
			 })
			 // #endif
			 
			 // #ifdef H5
			  _self.$mp.page.$getAppWebview().setStyle({
				  titleText:"h5 首页"
			  })
			 // #endif
		},
		methods: {
			redirect:function(){
				// 下面两个是一样的效果
				// console.log(_self.$mp.page.route);
				// console.log(getCurrentPages()[0].route);
			}
		}
	}
</script>

<style>
	
	.content {
		text-align: center;
		height: 400upx;
	}

	.logo {
		height: 200upx;
		width: 200upx;
		margin-top: 200upx;
	}

	.title {
		font-size: 36upx;
		color: #8f8f94;
	}
</style>
